/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pa165.dominatingspecies.frontend.pages;

import pa165.dominatingspecies.frontend.environment.EnvironmentsPage;
import pa165.dominatingspecies.frontend.animal.AnimalsPage;
import pa165.dominatingspecies.frontend.element.ElementsPage;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.springframework.security.access.prepost.PreAuthorize;
import pa165.dominatingspecies.frontend.security.Authorizer;
import pa165.dominatingspecies.frontend.user.UserPage;

/**
 *
 * @author Ondrej Prazak
 */
@PreAuthorize("hasRole('WORKER')")
public class BasePage extends WebPage {

    public BasePage() {
        super();

        //main navigation
        add(new BookmarkablePageLink<Void>("home", MainPage.class));
        add(new BookmarkablePageLink<Void>("animals", AnimalsPage.class));
        add(new BookmarkablePageLink<Void>("environments", EnvironmentsPage.class));
        add(new BookmarkablePageLink<Void>("elements", ElementsPage.class));
        Link users = new BookmarkablePageLink<>("users", UserPage.class);
        
        Authorizer.authorize(users);
        add(users);
                
        add(new FeedbackPanel("feedbackPanel"));
    }
}
